clear; clc;

%% Generate the Baseline Results
FileName    =   'Result_Investment';
StdVec      =   [1 1 1 -1 -1 60 -10]'*0.01/4;
PP          =   Setup_PP(struct('KAPPA',0.00/4,'XI',1/82.5/4,'Pir_SS',0.02/4,...
                                'Flag_dE',0,'Flag_Price',0,...
                                'B_Total_SS',0.86,'b_lb',-0.37,...
                                'TrProb_H',0.96,'Prob_H',0.37,...
                                'TrProb_ext',0.92,'Prob_ext',0.33,...
                                'Fin_DomShare',0.79,'Fin_AdjCost',0.8,...
                                'CapAdjCost',0.1,...
                                'RHO_M_dom',0.68,'RHO_M_ext',0.81,'RHO_Y_H',0.5,'RHO_p_F',0.90,...
                                'Taylor_Pi',1.1,'Taylor_ir',0.87,...
                                'Cons_ElasTN',6.19,'Cons_ElasHF',6.19));

SOLUTION    =   Solver_Main(PP,StdVec);
%% Different Results
SOLUTION.IRF=   TempFun_AugIRF(SOLUTION.PP,SOLUTION.SS,SOLUTION.MODEL,SOLUTION.EquJac,SOLUTION.IRF);


save('SOLUTION.mat','SOLUTION');

%% Figures
Figure_Unit('TableGraphs//Main//',SOLUTION.SS,SOLUTION.IRF);
%% Decomposition
Step_2_Decomposition(SOLUTION,['TableGraphs//Main//Decomposition//']);


%% Alternative
% TempPP  =   PP;
% % TempPP.Taylor_ir    =   0.95;
% TempPP.CapAdjCost   =   0.1;
% 
% [IRF,SOLUTION]  =   TempFun_NewIRF(TempPP,SOLUTION.SS,SOLUTION.MODEL,SOLUTION.EquJac,StdVec);
% Figure_Unit('TableGraphs//Alternative/',SOLUTION.SS,SOLUTION.IRF);
